package com.ruoyi.ora.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ora.mapper.DeviceRecordMapper;
import com.ruoyi.ora.domain.DeviceRecord;
import com.ruoyi.ora.service.IDeviceRecordService;

/**
 * 设备通讯记录，考虑分Service业务层处理
 * 
 * @author liuwp
 * @date 2024-11-14
 */
@Service
public class DeviceRecordServiceImpl implements IDeviceRecordService 
{
    @Autowired
    private DeviceRecordMapper deviceRecordMapper;

    /**
     * 查询设备通讯记录，考虑分
     * 
     * @param id 设备通讯记录，考虑分主键
     * @return 设备通讯记录，考虑分
     */
    @Override
    public DeviceRecord selectDeviceRecordById(Long id)
    {
        return deviceRecordMapper.selectDeviceRecordById(id);
    }

    /**
     * 查询设备通讯记录，考虑分列表
     * 
     * @param deviceRecord 设备通讯记录，考虑分
     * @return 设备通讯记录，考虑分
     */
    @Override
    public List<DeviceRecord> selectDeviceRecordList(DeviceRecord deviceRecord)
    {
        return deviceRecordMapper.selectDeviceRecordList(deviceRecord);
    }

    /**
     * 根据业务主键查询一条记录：设备通讯记录，考虑分
     *
     * @param deviceRecord 设备通讯记录，考虑分
     * @return 设备通讯记录，考虑分
     */
    @Override
    public DeviceRecord selectOneDeviceRecord(DeviceRecord deviceRecord)
    {
        return deviceRecordMapper.selectOneDeviceRecord(deviceRecord);
    }

    /**
     * 新增设备通讯记录，考虑分
     * 
     * @param deviceRecord 设备通讯记录，考虑分
     * @return 结果
     */
    @Override
    public int insertDeviceRecord(DeviceRecord deviceRecord)
    {
        deviceRecord.setCreateTime(DateUtils.getNowDate());
        return deviceRecordMapper.insertDeviceRecord(deviceRecord);
    }

    /**
     * 修改设备通讯记录，考虑分
     * 
     * @param deviceRecord 设备通讯记录，考虑分
     * @return 结果
     */
    @Override
    public int updateDeviceRecord(DeviceRecord deviceRecord)
    {
        return deviceRecordMapper.updateDeviceRecord(deviceRecord);
    }

    @Override
    public int updateDeviceRecordCondition(DeviceRecord deviceRecord, DeviceRecord deviceRecordCondition)
    {
        return deviceRecordMapper.updateDeviceRecordCondition(deviceRecord, deviceRecordCondition);
    }

    /**
     * 批量删除设备通讯记录，考虑分
     * 
     * @param ids 需要删除的设备通讯记录，考虑分主键
     * @return 结果
     */
    @Override
    public int deleteDeviceRecordByIds(Long[] ids)
    {
        return deviceRecordMapper.deleteDeviceRecordByIds(ids);
    }

    /**
     * 删除设备通讯记录，考虑分信息
     * 
     * @param id 设备通讯记录，考虑分主键
     * @return 结果
     */
    @Override
    public int deleteDeviceRecordById(Long id)
    {
        return deviceRecordMapper.deleteDeviceRecordById(id);
    }

    /**
     * 条件删除设备通讯记录，考虑分
     *
     * @param deviceRecord 设备通讯记录，考虑分
     * @return 结果
     */
    @Override
    public int deleteDeviceRecordByCondition(DeviceRecord deviceRecord)
    {
        return deviceRecordMapper.deleteDeviceRecordByCondition(deviceRecord);
    }

}
